package com.hardydou.jmm;

import java.io.Serializable;

/**
 * 虚拟机-内存结构-栈帧-动态链接
 *
 * @author hardy
 */
public class DynamicLink {

    public static void say() {
        System.out.println(" Hello word !");
    }

    static abstract class Human {
        abstract void say();
    }

    static class Man extends Human {

        @Override
        void say() {
            System.out.println("Hello man");
        }
    }

    static class Woman extends Human {
        @Override
        void say() {
            System.out.println("Hello woman");
        }
    }

    public void say(Human human) {
        System.out.println("Hello guy !");
    }

    public void say(Man man) {
        System.out.println("Hello man !");

    }

    public void say(Woman woman) {
        System.out.println("Hello woman !");
    }


/*
    public void say(Object obj) {
        System.out.println("Hello object");
    }
*/

/*    public void say(int arg) {
        System.out.println("Hello int");
    }*/

/*    public void say(long arg) {
        System.out.println("Hello long");
    }*/

/*    public void say(Character arg) {
        System.out.println("Hello character");
    }*/

/*    public void say(char arg) {
        System.out.println("Hello char");
    }*/

    public void say(char... arg) {
        System.out.println("Hello char ...");
    }
/*    public void say(Serializable arg) {
        System.out.println("Hello serializable");
    }*/

}
